﻿// Copyright (c)  YISH. All rights reserved.
// Licensed under the MIT License, See License.txt in the project root for license information.

using System.Diagnostics;
using NSQL.Sharpen;
using NSQL.Extensions;

namespace NSQL.Expressions
{
    [DebuggerDisplay("{ToString()}")]
    public abstract class BaseExpression : IExpression
    {
        public string TypeClass => GetType().Name;

        public abstract T Accept<T>(IExpressionVisitor<T> visitor);
        public abstract void Accept(IExpressionVisitor visitor);
        public abstract bool IsValid { get; }

        public override string ToString() => this.ToSql();

        object IDeepClone.DeepCopy() => DeepCopy();

        protected abstract IExpression DeepCopy();

        public object Tag { get; set; }
    }
}